package com.noexcs.forum.dao;

import com.noexcs.forum.entity.Comment;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author noexcs
 * @since 5/23/2022 7:23 PM
 */
@Mapper
public interface CommentMapper {

    /**
     * 查询评论
     *
     * @param entityType 帖子类型
     * @param entityId   帖子Id
     */
    List<Comment> selectCommentsByEntity(int entityType, int entityId, int offset, int limit);

    /**
     * 查询评论数量
     */
    int selectCountByEntity(int entityType, int entityId);

    int insertComment(Comment comment);
}
